Syntax Grammar

G(VT, VN, P, S)

VT = {BEGIN, END, ., PROGRAM, IDENTIFIER, NUMBER, ;, VAR, :, INTEGER, λ, :=, WHILE, DO, OF, -, +, *, /, (, )}

VN = {<S>, <Header>, <SA>, <SB>, <Part descriptions>, <Part operators>, <VB>, <VC>, <Assignement statement>, <While statement>, <Composite statement>, <Empty statement>, <AA>, <Expression>, <Condition>, <CA>, <M>, <RM>, <L>, <RL>, <E>}

<S> ::= PROGRAM<Header> | VAR <Part descriptions> | BEGIN<SB>
<SA> ::= VAR <Part descriptions> | BEGIN<SB>
<SB> ::= <Part operators><SB> | <Part operators> END .

<Header> ::= IDENTIFIER ; <SA>

<Part descriptions> ::= IDENTIFIER<VB>
<VB> ::= , <Part descriptions> | : <VC>
<VC> ::= INTEGER<VD> | ARRAY<VF>
<VF> ::= "[" ["-"] NUMBER ".." ["-"] NUMBER "]" OF INTEGER <VD>
<VD> ::= ;<VE>
<VE> ::= IDENTIFIER<VB> | VAR <Part descriptions> | BEGIN<SB>

<Part operators> ::= IDENTIFIER<Assignement statement> | WHILE<While statement> | BEGIN<Composite statement> | λ

<Assignement statement> ::= "[" <Expression> "]" <AA> | <AA> 
<AA> ::= := <Expression> ;

<While statement> ::= <Condition> DO <Part operators>
<Condition> ::= "(" <Condition> ")" | <Expression> ("<" | ">" | "<=" | ">=" | "<>" ) <Expression>

<Composite statement> ::= <Part operators><Composite statement> | <Part operators> END ;

<Expression> ::= <M><RM>
<RM> ::= +<M><RM> | -<M><RM> | λ
<M> ::= <L><RL>
<RL> ::= *<L><RL> | /<L><RL> | λ
<L> ::= +<L> | -<L> | <E>
<E> ::= IDENTIFIER | IDENTIFIER "[" <Expression> "]" | NUMBER | "("<Expression>")"

/*Подсчёт части выражений
Проверка индекса массива на границы*/